package com.web.itemService.service.userServiceImp;

import com.web.itemService.mappers.useMapper;
import com.web.itemService.service.userService;
import entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class userRegister implements userService {
    @Autowired
    useMapper useMapper;

    /**
     * 初始注册
     *
     * @param user
     */
    @Override
    public void register(User user) {
        useMapper.registerUser(user);
    }


    @Override
    public User login(String username, String password) {
        User userByNameAndPassword = useMapper.findUserByNameAndPassword(username, password);
        return userByNameAndPassword;
    }

    @Override
    public User findUserByUsernameAndPhone(String username, String phone) {
        return useMapper.findUserByNameAndPhone(username, phone);
    }

    @Override
    public User findUserByOpenID(String openid) {
        return useMapper.findUserByOpenid(openid);
    }


}
